package com.liruo.treasureattic.common.httpmsg.result;


public enum Errno {
    SUCCESS(0,"successful"),
    NO_ERR(1,"no err"),
    /**
     * 参数错误
     */
    PARAMS(40001,"参数错误"),
    UNSUPPORTED(40002,"不支持操作"),

    //不可控异常
    SYSTEM(50001,"系统故障"),
    //不可控异常，但是没有抛出该不可控异常
    BUSINESS_SYSTEM(50002,"business system 故障"),
    PROPERTIES(50003,"配置错误"),
    STORAGE(50004,"存储错误"),

    JWT(50005,"jwt验证错误"),
    STREAM(50006,"流操作错误"),
    INVALID_USER(50007,"无效user"),
    NOT_EXISTS(50008,"不存在"),
    ALREADY_EXISTS(50009,"已存在"),
    LOGIN(50010,"登录异常"),
    NOT_LOGIN(50011,"未登录"),
    INNER_API(50012,"远程api调用错误"),
    FRONT_BUSINESS_SYSTEM(50013, "前端系统错误"),
    TIME_OUT(50014, "过期");

    private final int code;
    private final String msg;

    Errno(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public int getCode() {
        return code;
    }
    public String getMsg() {
        return msg;
    }

    @Override
    public String toString() {
        return "\"{" +
                "\"code\":" + code + ","+
                "\"msg=\":" + "\"" +msg +"\""+
                "}\"";
    }
}
